package com.purchase.ml.entity.prod;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_product_pic")
@ApiModel(value = "SysProductPic", description = "商品图片表")
public class SysProductPic implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "主键id")
    private Integer id;

    /**
     * 图片地址
     */
    @TableField(value = "pic_url")
    @ApiModelProperty(value = "图片地址")
    @NotBlank(message = "URL gambar tidak boleh kosong")
    private String picUrl;

    /**
     * 产品ID
     */
    @TableField(value = "product_id")
    @ApiModelProperty(value = "产品ID")
    private Long productId;

    /**
     * 图片索引
     */
    @TableField(value = "`index`")
    @ApiModelProperty(value = "图片索引，数值小的是主图")
    private Integer index;

}